package com.huashizhaoxi.lionapp.service.Impl;

import com.huashizhaoxi.lionapp.dao.FruitOrderMapper;
import com.huashizhaoxi.lionapp.dao.PayMapper;
import com.huashizhaoxi.lionapp.entity.Payment;
import com.huashizhaoxi.lionapp.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PayServiceImpl implements PayService {

    @Autowired
    private PayMapper payMapper;

    @Override
    public int checkOrder(String orderNo) {
        return payMapper.checkOrder(orderNo);
    }

    @Override
    public void updateOrder(String orderNo, String transactionId) {
        payMapper.changeStatus(orderNo,2);
        payMapper.updateOrder(orderNo, transactionId);
    }


    @Override
    public void changeState(String orderNo, int state) {
            payMapper.changeStatus(orderNo,state);
    }

    @Override
    public Payment getPayConfig(String orderNo) {
        return payMapper.getPayConfig(orderNo);
    }
}
